package com.lywz.web.action.food;

import java.util.List;

import com.lywz.biz.common.entity.goodfood.ClassicFood;
import com.lywz.biz.common.entity.goodfood.Restaurant;
import com.lywz.biz.common.entity.goodfood.SpecialSnack;
import com.lywz.core.exception.SSException;
import com.lywz.core.log.LogClerk;
import com.lywz.web.struts.GZAbstracterAction;

/**
 * @author qianqi yangbolin
 * @date 2010-5-1
 */
public class ShowClassicFoodAction extends GZAbstracterAction {

    private static final long serialVersionUID = 5659902782178013271L;

    private ClassicFood classicFood;

    private int classicFoodId;

    private List<Restaurant> restaurantList;

    private List<ClassicFood> topTenList;

    private List<SpecialSnack> specialSnackList;
    
    private int specialSnackId;
    
    private SpecialSnack specialSnack;

    
    
    /**
     * @return the specialSnackId
     */
    public int getSpecialSnackId() {
        return specialSnackId;
    }
    
    /**
     * @param specialSnackId the specialSnackId to set
     */
    public void setSpecialSnackId(int specialSnackId) {
        this.specialSnackId = specialSnackId;
    }


    /**
     * @return the specialSnack
     */
    public SpecialSnack getSpecialSnack() {
        return specialSnack;
    }

    
    /**
     * @param specialSnack the specialSnack to set
     */
    public void setSpecialSnack(SpecialSnack specialSnack) {
        this.specialSnack = specialSnack;
    }

    public List<ClassicFood> getTopTenList() {
        return topTenList;
    }

    public List<SpecialSnack> getSpecialSnackList() {
        return specialSnackList;
    }

    public void setSpecialSnackList(List<SpecialSnack> specialSnackList) {
        this.specialSnackList = specialSnackList;
    }

    public void setTopTenList(List<ClassicFood> topTenList) {
        this.topTenList = topTenList;
    }

    public int getClassicFoodId() {
        return classicFoodId;
    }

    public void setClassicFoodId(int classicFoodId) {
        this.classicFoodId = classicFoodId;
    }

    public ClassicFood getClassicFood() {
        return classicFood;
    }

    public void setClassicFood(ClassicFood classicFood) {
        this.classicFood = classicFood;
    }

    public List<Restaurant> getRestaurantList() {
        return restaurantList;
    }

    public void setRestaurantList(List<Restaurant> restaurantList) {
        this.restaurantList = restaurantList;
    }

    public String getOneClassicFood() {
        try {
            classicFood = classicFoodService.getOneClassicFoodById(classicFoodId);
            restaurantList = restaurantService.getRestaurantsListByClassicFoodId(classicFoodId);
            return "oneClassicFood";
        } catch (SSException e) {
            LogClerk.sysout.error(e);
            return ERROR;
        }
    }

    public String getTopTenClassicFoodList() {
        try {
            topTenList = classicFoodService.getTopTenList(10);
            return "toClassicList";
        } catch (Exception e) {
            LogClerk.sysout.error(e);
            return ERROR;
        }
    }

    public String getTopTenSpecialSnackList() {
        try {
            specialSnackList = specialSnackService.getSpecialSnackListByPower(10);
            return "toSpecialSnackList";
        } catch (Exception e) {
            LogClerk.sysout.error(e);
            return ERROR;
        }
    }
    
    public String getSpecialSnackDetail(){
        try{
            specialSnack = specialSnackService.getOneSpecialSnack(specialSnackId);
            return "toSpecialSnackDetail";
        } catch (Exception e){
            LogClerk.sysout.error(e);
            return ERROR;
        }
    }
}
